/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.core;

import info.peigen.hotpot.common.service.base.ServiceOrderBase;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

/**
 * <b>(GatewayOrderBase)</b>
 * 网关Order基类，后续会对其进行整理和抽象，不可包含各渠道个性化内容
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/4/16
 */
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PROTECTED)
@Accessors(chain = true)
public class GatewayOrderBase extends ServiceOrderBase {

    /** 订单号，不传入则等同gid */
    @NotEmpty
    @Size(max = 30)
    @Pattern(regexp = "^[A-Za-z0-9]+$", message = "orderId格式错误")
    String orderId;

    /** 交易码，有些渠道的不同接口是以不同的交易码来表示 */
    String transCode;

    /** 交易URL，有些渠道的不同接口是以不同的URL来表示 */
    String transUrl;
}